/*
 * @Author: toString muzi_li0323@163.com
 * @Date: 2024-05-15 20:02:50
 * @LastEditors: toString muzi_li0323@163.com
 * @LastEditTime: 2024-05-15 20:13:29
 * @FilePath: /chain-link-api-front/src/language/index.js
 * @Description:
 */
import { createI18n } from "vue-i18n";
import zhCN from "./locales/zh-cn.json";
import zhTW from "./locales/zh-tw.json";
import enUS from "./locales/en-us.json";
import koKR from "./locales/ko-kr.json";
import jaJP from "./locales/ja-jp.json";



let language = localStorage.getItem("language") || navigator.language; //  获取本地存储 || 根据浏览器语言设置


const i18n = createI18n({
  legacy: false,
  locale: language,
  globalInjection: true,
  messages: {
    "zh-CN": zhCN,
    "zh-TW": zhTW,
    "en-US": enUS,
    "ko-KR": koKR,
    "ja-JP": jaJP,
  },
});

export default i18n;
